/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ReplInfoFrame.java
 *
 * Created on Jan 27, 2009, 4:56:47 PM
 */

package org.enclojure.ide.repl;

/**
 *
 * @author nsinghal
 */
public class ReplInfoFrame extends javax.swing.JFrame {

    /** Creates new form ReplInfoFrame */
    private ReplInfoFrame() {
        initComponents();
    }

    private void setMessage(String title, String msg)
    {
        this.setTitle(title);
        msgBox.setText(msg);
    }

    public static ReplInfoFrame _replInfoFrame = null;

    public static void Show(String title, String msg)
    {
        if(_replInfoFrame == null) _replInfoFrame = new ReplInfoFrame();
        _replInfoFrame.setMessage(title, msg);
        _replInfoFrame.setVisible(true);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        msgBox = new javax.swing.JTextArea();
        okButton = new javax.swing.JButton();

        setAlwaysOnTop(true);

        msgBox.setColumns(20);
        msgBox.setRows(5);
        jScrollPane1.setViewportView(msgBox);

        okButton.setText("OK");
        okButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                okButtonActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 690, Short.MAX_VALUE)
            .add(layout.createSequentialGroup()
                .add(okButton)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)
                .add(18, 18, 18)
                .add(okButton)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
        this.dispose();
    }//GEN-LAST:event_okButtonActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea msgBox;
    private javax.swing.JButton okButton;
    // End of variables declaration//GEN-END:variables

}
